disableSerialization;
_display = finddisplay 8000;

//Chopper Data
_chop = _display displayctrl 108;
_chop ctrlShow true;

//Comms
_c= _display displayctrl 99;
_c ctrlSetTextColor [0.9,0.9,0.9,1];

//Harrier Data
_harr = _display displayctrl 109;
_harr ctrlShow true;

_i=0;
while {Dialog} do 
{
    ctrlSetText [110,format ["%1",[daytime] call TimeToString]];
    _list= [] call cpu_obj;

    if(ExtractionOn!=-1) then 
    {
        if (canMove uhEVAC) then 
        {
            "Track_Evac" setMarkerPos position uhEVAC;"Track_Evac" setMarkerDir getdir uhEVAC;
            _f=fuel uhEVAC - fuel uhEVAC mod 0.1;
            _d=damage uhEVAC - damage uhEVAC mod 0.1;
            _text="";
            _text = _text + format ["EVAC Chopper Position: %1",[uhEVAC] call GetRCoord] + "<br />";
            _text = _text + format ["EVAC Chopper Fuel Level: %1",_f] + "<br />";
            _text = _text + format ["EVAC Chopper Damage: %1",_d] + "<br />";
            _chop ctrlSetFont "LucidaConsoleB";
            _chop ctrlSetTextColor [0.9,0.9,0.9, 1];
            _chop ctrlSetStructuredText parseText _text;
        };
    };

    if(CASOn!=-1) then 
    {
        "CAS_Marker" setMarkerPos position LaserGL;
        "Track_CAS" setMarkerPos position harrier;
        "Track_CAS" setMarkerDir getdir harrier;
        if (canMove harrier) then 
        {
            _f=fuel harrier - fuel harrier mod 0.1;
            _d=damage harrier - damage harrier mod 0.1;
            _text="";
            _text = _text + format ["Harrier Position: %1",[harrier] call GetRCoord] + "<br />";
            _text = _text + format ["Harrier Fuel Level: %1",_f] + "<br />";
            _text = _text + format ["Harrier Damage: %1",_d] + "<br />";
            _harr ctrlSetFont "LucidaConsoleB";
            _harr ctrlSetTextColor [0.9,0.9,0.9, 1];
            _harr ctrlSetStructuredText parseText _text;
        };
    };
    
    while {_i<count _list} do 
    {
        _d=ceil (player distance (_list select _i));
        _p=(_d/500);
        _r=[_list select _i] call GetRCoord;
        call compile format ["""Track_AA%1"" setMarkerPos position (_list select _i)",_i];
        _index = lbAdd [107, format ["Vehicle %1m.(at %2) Interception Chances: %3/100",_d,_r,_p]];
        lbSetData [107, _index, _list select _i];
        if (random 100<_p) then {EnemyD=(_list select _i);
        PublicVariable "EnemyD";
        RadioOp=player;
        PublicVariable "RadioOp";
        CommIntercepted=true;
        publicVariable "CommIntercepted";
        _c ctrlSetTextColor [1,0,0,1];
        _c ctrlSetText "Communication Intercepted!"};
        _i=_i+1;
    };

    sleep 1;
    _i=0;
    lbclear 107;
};
if (true) exitWith {};